package jdklearn.collectionAndMap.遍历;

/**
 * author Veng Su
 * email  1344114844@qq.com
 * date   18-9-1 下午3:25
 */
import java.util.*;

public class TestListIterator
{
    public static void main(String[] args)
    {
        String[] books = {
                "疯狂Java讲义",
                "轻量级Java EE企业应用实战"
        };
        List bookList = new ArrayList();
        for (int i = 0; i < books.length ; i++ )
        {
            bookList.add(books[i]);
        }
        ListIterator lit = bookList.listIterator();
        while (lit.hasNext())
        {
            System.out.println(lit.next());
            lit.add("-------分隔符-------");
        }
        System.out.println("=======下面开始反向迭代=======");
        while(lit.hasPrevious())
        {
            System.out.println(lit.previous());
        }
    }
}
